<?php
/* Function to detect the user language */
function getLanguage(){	$idioma =substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); if($idioma != 'en' && $idioma != 'pt'){$idioma ='es';}  return $idioma; }
$lg=getLanguage();
include'form_controller.php';

$xajax->register(XAJAX_FUNCTION, 'process_form_val');
$xajax->processRequest();

$xml_words=get_xml_strings($lg); //Get the words contained in the language XML

//echo $xml->mail;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo getLanguage(); ?>" xml:lang="<?php echo getLanguage(); ?>">

<head>
  	<title><?php echo $xml_words->page_title; ?></title>
  	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  	<link rel="stylesheet" type="text/css" href="style.css" />
  	<?php $xajax->printJavascript("xajax/"); /*Print Xajax JavaScripts*/ ?>
  	<script src="js/prototype.js" type="text/javascript"></script>
	<script src="js/validation.js" type="text/javascript"></script>
	<script src="js/effects.js" type="text/javascript"></script>
	<script src="js/fabtabulous.js" type="text/javascript" ></script>
<body>
<form name="form_experiencia_vida" id="form_experiencia_vida">
<fieldset id="form_content">
<input type="hidden" name="chance" value="0" />
<input type="hidden" name="lang" value="<?php echo $lg; ?>" />
<div class="form-row"><label for="email"><?php echo $xml_words->mail; ?></label> <input type="text" id="email" class="required validate-email"name="email" /></div>
<span class="help_info"><?php echo $xml_words->first_time_help; ?></span>
</div><br />
<input type="button" value="<?php echo $xml_words->send_button; ?>" onclick="valid.validate()">
</fieldset>
</form> 
					<script type="text/javascript">
						function formCallback(result, form) {
							if(result==true){xajax_process_form_val(xajax.getFormValues('form_experiencia_vida'));}
								else {window.status = "valiation callback for form '" + form.id + "': result = " + result;}
						}
						var valid = new Validation('form_experiencia_vida', {immediate : true, onSubmit : false, onFormValidate : formCallback});
					</script>
</body>

</html> 
